Backup and Restore
CODESYS and the CODESYS the standard runtime systems (with version 3.5.8.0 and higher) support backing up application-specific files on the PLC. You can execute the required actions in the Backup and Restore tab of the generic device editor.
A backup consists of creating and saving a file in zip archive that contains the application-related files and an information file meta.info
. This backup file has the extension TBF
(="Target Backup File") and can be saved in the local file system or on the PLC.
The following applies when restoring the software status from the backup file:
A dialog opens with a list of affected files on the PLC, and you can deactivate optional components.
If you need to put the application in STOP mode for saving or restoring, you will be notified. Likewise, messages are displayed in case of incompatibilities.
The user interface is blocked when restoring to the PLC.
Existing files are overwritten without warning.
Existing boot applications are deactivated as soon as at least one new boot application is part of the restore.
Creating backup files
Requirement: A project is open with an application that is running on the required device. In addition, for this example an external file myExternalFile.txt
is inserted as an object below the application. This file is downloaded to the PLC implicitly when downloading the application.
Open the device editor by double-clicking the device entry in the device tree. Click the Backup and Restore tab.
The tab is displayed. It contains a menu bar including the Backup and Restore menus.
In the Backup menu, click Read Backup Information from Device.
If the PLC is not connected at the moment, then CODESYS opens a temporary connection to the device and reads the relevant files from the
$PlcLogic$
directory of the PLC into a table in the lower part of the tabbed page. In this example, at least the following files will be listed:$PlcLogic$/Application/Application.app
,$PlcLogic$/Application/Application.crc
, and$PlcLogic$/Application/myExternalFile.txt
. In addition, other external, project-dependent files are listed, which have been inserted below the application in the device tree. Furthermore, the source code archive file$PlcLogic$/Archive.prj
is listed if you have set the project setting for this (Implicitly at program download and online change) as the loading time.In the table, clear the check box for the
$PlcLogic$/Application//myExternalFile.txt
file in the Active column.In the Backup menu, click Save Backup File to Device.
The Save as dialog opens. The file type is predefine as Backup files (*.tbf).
Select a location for the backup file and click Save.
Restoring from backup files
Requirement: A project is open with an application that is running on the required device. A backup file is saved to the local file system as described above.
Open the device editor by double-clicking the device entry in the device tree. Click the Backup and Restore tab.
Click
.The default prompt opens for selecting a backup file
tbf
in the local file system.Select the backup file and click Open.
The files are read from the backup file and shown in the table of the dialog below. The file
$PlcLogic$/Application/myExternalFile.txt
that was excluded in the backup is missing.Click
.A dialog prompt opens with information about the actions when restoring.
Click OK to start restoring the files to the PLC file system.
When restore is complete, you are prompted to restart the PLC in order to activate the loaded application.